package com.egene.tw;

import com.egene.tw.applib.controller.HXSDKHelper;
import com.egene.tw.applib.model.HXSDKModel;
import com.egene.tw.base.BaseApplication;
import com.egene.tw.network.ApiHttpClient;
import com.loopj.android.http.AsyncHttpClient;

import io.realm.Realm;
import io.realm.RealmConfiguration;

/**
 * Created by WZX on 2015/7/17.
 */
public class AppContext extends BaseApplication {


    HXSDKHelper hxsdkHelper = new HXSDKHelper() {
        @Override
        protected HXSDKModel createModel() {
            return new DemoHXSDKModel(AppContext.this);
        }
    };

    @Override
    public void onCreate() {
        super.onCreate();

        // 初始化网络请求
        AsyncHttpClient client = new AsyncHttpClient();
        ApiHttpClient.setHttpClient(client);


        HXSDKHelper.getInstance().onInit(this);

//        PushManager.getInstance().initialize(this.getApplicationContext(), PushService.class);
//        PushManager.getInstance().registerPushIntentService(this.getApplicationContext(), PushIntentService_.class);

//        boolean success = EMChat.getInstance().init(this);

        Realm.init(this);
        Realm.setDefaultConfiguration(new RealmConfiguration.Builder().deleteRealmIfMigrationNeeded().build());

    }
}
